package com.yxh.www.author.api;

import com.yxh.www.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * <p>
 * 授权中心 - 系统第三方账户接口关系控制API集
 * </p>
 *
 * @author yangxiaohui
 * @since 2020/5/12
 */
@FeignClient(value = "author-server", contextId = "authorSmAccountApiRelation")
public interface AuthorSmAccountApiRelationApi {
    /**
     * 增加第三方账户接口关系
     *
     * @param accountId 第三方账户ID
     * @param apiIds     接口ID集合
     * @return 统一响应 {@link Result}
     */
    @PostMapping("/smAccountApiRelation/addSmAccountApiRelation")
    Result<Object> addSmAccountApiRelation(@RequestParam String accountId,
                                           @RequestParam String[] apiIds);

    /**
     * 根据关系ID集合删除 账户接口关系
     * @param ids   关系ID集合
     * @return 统一响应 {@link Result}
     */
    @DeleteMapping("/smAccountApiRelation/removeSmAccountApiRelation")
    Result<Object> removeSmAccountApiRelation(@RequestParam String[] ids);

    /**
     * 根据第三方账户ID删除 账户接口关系
     *
     * @param accountId 第三方账户ID
     * @return 统一响应 {@link Result}
     */
    @DeleteMapping("/smAccountApiRelation/removeSmAccountApiRelationByAccountId")
    Result<Object> removeSmAccountApiRelationByAccountId(@RequestParam String accountId);

    /**
     * 根据接口ID删除 账户接口关系
     *
     * @param apiId 接口ID
     * @return 统一响应 {@link Result}
     */
    @DeleteMapping("/smAccountApiRelation/removeSmAccountApiRelationByApiId")
    Result<Object> removeSmAccountApiRelationByApiId(@RequestParam String apiId);

    /**
     * 根据接口ID和账户ID删除 账户接口关系
     *
     * @param accountId 第三方账户ID
     * @param apiId     接口ID
     * @return 统一响应 {@link Result}
     */
    @DeleteMapping("/smAccountApiRelation/")
    Result<Object> removeSmAccountApiRelationByAccountIdAndApiId(@RequestParam String accountId,
                                                                 @RequestParam String apiId);
}
